package com.eastseeway.radioproject.retrofit;

public class HttpBaseResult<T> {
//    public static int STATUS_EXCEPTION = -1;
//    public static int STATUS_FAILURE = -2;
//    public static int STATUS_NETWORK_UNCONNECTED = -10;
//    public static int STATUS_NETWORK_READTIME_OUT = -11;
    public static final int STATUS_OK = 200;

    private int errcode;
    private String errmsg;
    private T data;
//    private int status;
//    private long timeElapsed;
//    private long timestamp;


    public int getErrcode() {
        return errcode;
    }

    public void setErrcode(int errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

//    public int getStatus() {
//        return status;
//    }
//
//    public void setStatus(int status) {
//        this.status = status;
//    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return (errcode == STATUS_OK || errcode == 0) || (String.valueOf(STATUS_OK).equals(errcode));
    }
}
